Learn T-SQL Commands with Samples
Skip Navigation Links
Skip Navigation Links.
Expand DatabaseDatabase
Expand TableTable
Expand ViewView
Expand Stored ProcedureStored Procedure
Expand Data FilteringData Filtering
Expand Data GroupingData Grouping
Expand JoinsJoins
Expand TriggerTrigger
Expand CursorCursor
Expand OperatorsOperators
Expand ConstraintsConstraints
Expand FunctionsFunctions
Expand Conditional ProcessingConditional Processing
Expand LoopingLooping
Expand Error HandlingError Handling
Expand v.IMP Queriesv.IMP Queries
Expand XMLXML
Expand Query PerformanceQuery Performance
Expand QueriesQueries
Expand NormalizationNormalization
Collapse CreateCreate
     

User Defined Type

 
      
---- Create the assembly reference that contains the type definition
CREATE ASSEMBLY utf8string FROM '\\ComputerName\utf8string\utf8string.dll' ; GO
---- Create the new data type
CREATE TYPE Utf8String EXTERNAL NAME utf8string.[Microsoft.Samples.SqlServer.utf8string]; GO
---- Create a table that uses the data type
CREATE TABLE dbo.myTable ( ID int NOT NULL, Name Utf8String ) GO
---- Drop the new data type
DROP TYPE Utf8String; GO